<include file="public@header" />

</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
        <li ><a href="{:url('Shop/index')}">店铺列表</a></li>
        <li class="active"><a href="#">编辑店铺</a></li>
    </ul>
    <form class="form-horizontal js-ajax-form margin-top-20" role="form" action="{:url('Shop/edit')}" method="post">
        <fieldset>
            <div class="tabbable">
                <div class="tab-content">
                    <div class="tab-pane active" id="A">
                         <div class="form-group">
                            <label  class="col-sm-2 control-label"><span class="form-required">*</span>店铺名称</label>
                            <div class="col-md-6 col-sm-10">
                             <input name="id" value="{$info.id}" style='display:none;'>
                                <input type="text" class="form-control" id="input-code" name="shop_name" value="{$info.shop_name}">
                            </div>
                        </div> 
                        <div class="form-group">
                            <label  class="col-sm-2 control-label"><span class="form-required">*</span>店铺地址</label>
                            <div class="col-md-6 col-sm-10">
                                <input type="text" class="form-control" id="input-code" name="address" value="{$info.address}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-sm-2 control-label"><span class="form-required">*</span>代理平台名称</label>
                            <div class="col-md-6 col-sm-10">
                                <if condition="$id == 1">
                                    <select name="agency_id" onchange="shoptype($(this).val())">
                                        <option value="0">请选择</option>
                                        <foreach name='agency_list' item='vo'>
                                        <option value="{$vo.user_id}" <if condition="$info['agency_id'] eq $vo['user_id']"> selected</if>>{$vo.brand_name}</option>
                                        </foreach>
                                    </select>
                                <else />

                                </if>
                            </div>
                        </div>
                         <div class="form-group">
                            <label  class="col-sm-2 control-label"><span class="form-required">*</span>类别</label>
                            <div class="col-md-6 col-sm-10" id="shop_type">
                                <select name="stype_id">
                                    <option value="0">请选择</option>
                                    <foreach name='type_list' item='vt'>
                                    <option value="{$vt.st_guid}" <if condition="$info['stype_id'] eq $vt['st_guid']"> selected</if>>{$vt.type_name}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit" data-refresh="0" >{:lang('SAVE')}</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script>
    function shoptype(id){
        if(id !=''){
            $.post("{:url('Shop/getShoptype')}",{'id':id},function (date){
                var html = "";
                html+="<select id='stype_id' name='stype_id'>";
                for(var i=0;i<date.length;i++){
                    html+="<option value="+date[i].st_guid+">"+date[i].type_name+"</option>";
                }
                html+='</secect>';
                $('#shop_type').html(html);
            });
        }else{
            $('#shop_type').empty();
        }

    }
</script>
</body>
</html>